docs(api): enhance api descriptions for AI Agents#35382
Conversation
|
Claude finished @rjvelazco's task in 3m 26s —— View job Review — latest changesThe follow-up commits address the highest-leverage items from the previous AI-optimization pass: What's now resolved
Worth a second look1.
The simplest safe move: leave the guard as-is and add a 2. Scope creep in a 3. Inconsistent Java-source indentation in 4. Hardcoded Copy action UUID in prose. 5. 6. Still open from prior review (acknowledged, intentionally deferred)
VerdictClean. The structural improvements are real and the new defensive code is reasonable. The blast-radius question on
|
- Remove **Required.** from `variable` in copyType request body (only `name` is required) - Move `variable`, `host`, `folder` from Required to Optional in createType (server-side defaults exist) - Fully qualify all `clazz` names with `com.dotcms.contenttype.model.type.` prefix - Fix `depth`/`languageId` schema format: int64 → int32 in openapi.yaml - Remove PUBLISH-on-archived bug note from workflow fire endpoint (belongs in issue tracker, not API spec) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…erequisites, and build/test commands
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…-on-mcp-testing-feedback' of https://github.com/dotCMS/core into issue-35381-improve-openapi-endpoint-descriptions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
|
@claude review this changes but focus on how the docs are/can be optimized for AI |
|
Claude finished @rjvelazco's task in 2m 52s —— View job Review — AI-Optimization FocusThis is a strong documentation pass: the new prose captures most of the non-obvious contract details that bit you in MCP testing (binary vs image acceptance, What's working well for AI consumers
Optimizations / issues for AI consumption1. Repeated 2. Enums live in prose, not in
Promoting these to 3. 4. The 5. 6. Move/Copy body shape is prose-only. The most error-prone fact in the PR — 7. Mismatch between the 8. Markdown tables in description strings are fragile. Several tables in 9. Non-ASCII characters (
10. New validation-error shape is described but not modeled. The example body for 11. Copy action 12. Scope creep — Suggested follow-up issues (out of PR scope)
VerdictContent quality is excellent — this captures the hard-earned MCP testing knowledge. The main lift to make it AI-optimal rather than just AI-friendly is structural: pull enums out of prose into
|
…-on-mcp-testing-feedback' of https://github.com/dotCMS/core into issue-35381-improve-openapi-endpoint-descriptions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…tions-based-on-mcp-testing-feedback
…acefully. Update MultiPartUtilsTest to improve coverage for multipart request scenarios, ensuring no NullPointerException is thrown when file parts are missing or empty.
…-on-mcp-testing-feedback' of https://github.com/dotCMS/core into issue-35381-improve-openapi-endpoint-descriptions-based-on-mcp-testing-feedback
Summary
Improves OpenAPI endpoint descriptions based on findings from MCP integration testing with Claude Code. Documentation-only — no functional behavior changes. All edits live in Java
@Operation/@Parameter/@RequestBodyannotations;openapi.yamlis regenerated from those by the Swagger Maven plugin.Closes #35381.
Endpoints touched
NavResource—GET /api/v1/nav/{uri}urimust resolve to a folder; page URIs return 404./as the way to fetch the site-root tree.depthsemantics (level-1 = starting node, < 1 coerced to 1, exceeding actual depth returns full subtree).languageIddescription: tags nodes but does not translate folder names.depth/languageIdas integers.ContentTypeResource/api/v1/contenttype— replaced the wrapper-style body description with the real contract: requiredclazz/name, enumerated validclazzvalues, optionalhost/folder/workflow/fields/metadata/systemActionMappings, the singular-vs-pluralworkflow↔workflowsround-trip pitfall, field-object schema (incl. boolean-via-radio pattern), Row/Column layout encoding./api/v1/contenttype/id/{idOrVar}— elevated the "destructive PUT" warning, documented the GET → mutate → PUT pattern with theworkflows → workflowrename, and added a warning thatsystemActionMappingsis validated on write./api/v1/contenttype/id/{idOrVar}— noted thatentityis a JSON-encoded string, requiringJSON.parse./api/v1/contenttype/_filter— added comparison toGET /api/v1/contenttype?filter=./api/v1/contenttype/{variable}/_copy— documented what the copy preserves./api/v1/contenttype/id/{idOrVar}— explained how to inspectfields[].clazzto choose betweenImmutableBinaryFieldandImmutableImageField.TempFileResource—POST /api/v1/tempandPOST /api/v1/temp/byUrltempFiles[0].idas the field value when firing a workflow action.WorkflowResourcePUT /api/v1/workflow/actions/default/fire/{systemAction}— full rewrite covering: request-body envelope, structured validation-error shape and knownerrorCodevalues, unknown fields silently dropped, Radio/Select/Checkbox values not validated, binary/image field workflows (Pattern A: single-usetemp_<id>; Pattern B: reusable dotAsset forImmutableImageFieldonly),ImmutableBinaryFieldvsImmutableImageFieldacceptance table, PUBLISH-on-archived warning, multi-scheme caveat, andindexPolicy=WAIT_FORguidance.PUT /api/v1/workflow/actions/{actionId}/fire— documented Move action body shape (pathToMoveis a sibling ofcontentlet, not nested) and the Copy action (default System Workflow id, response returns source not copy, destination hints silently ignored).indexPolicydocumented as a typed[DEFER, WAIT_FOR, FORCE]enum with per-value descriptions.POST .../actions/_bulkfireandPUT .../actions/bulk/fire— documented thatcontentletIdsexpects inodes (not identifiers), thatadditionalParams: {}is required, that the endpoint is not step-aware, and that the two paths are aliases differing only in transport.GET /api/v1/workflow/contentlet/{inode}/actions— documented the empty-array-on-terminal-step ambiguity.POST /api/v1/workflow/actions— documented that supplyingstepIdalso attaches in one call, and the lack of an"anyone"constant.POST /api/v1/workflow/steps— documented thatescalationActionmust be""whenenableEscalation: false.Out of scope
Server-behavior proposals from the feedback doc (add
COPYas aSystemAction, populateactionInputs[].body, return the new copy on Copy, validate radio/select values, fix the multipart 500-on-missing-file, eager multi-scheme init) were intentionally not addressed — this PR is documentation-only.🤖 Generated with Claude Code
This PR fixes: #35381